package com.freemypay.java.十三字符串.四格式化输出;

public class Hex {
	public static String format(byte[] date) {
		StringBuilder result = new StringBuilder();
		int n = 0;
		for (byte b : date) {
			if(n % 16 == 0) {
				result.append(String.format("%05X: ", b));
			}
			result.append(String.format("%02X ", b));
			n++;
			if(n % 16 == 0) result.append("\n");
		}
		result.append("\n");
		return result.toString();
	}

	public static void main(String[] args) {
		if(args.length == 0) {
//			System.out.println(format(Binary));
		}else {
//			System.out.println(format(Binary));
		}
	}
}
